package com.wanxi.dangdang.mapper;

import com.wanxi.dangdang.model.pojo.Order;
import com.wanxi.dangdang.model.pojo.OrderDetails;
import com.wanxi.dangdang.model.vo.OrderPo;
import com.wanxi.dangdang.model.vo.OrderStateVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Component
public interface OrderMapper {
    List<Order> findPage();

    List<OrderDetails> findOrderDetailsById(Long id);

    void addInToOrderDetails(List<OrderDetails> orderDetailsList, Long orderId);

    void addInToOrder(OrderPo orderPo);

    int updateOrderState(OrderStateVo orderStateVo);

    List<Order> findByOrderState(Integer orderState);

    Order findOrderById(Long id);

    Order findByOrderNumber(String orderNumber);

    void updateStatusAndAdminId(OrderStateVo orderStateVo);

    List<Order> findByAdminId(Long adminId);

    List<Order> findDistributorOrderPage(@Param("storeId") Long storeId);

    int findAllOrdersByDate(Date today);

    BigDecimal findPriceTotalByDate(Date today);

    List<Order> findByStoreIdAndWeChatId(Long storeId, String weChatId);

    List<Order> findByStoreIdAndWeChatIdAndStatus(Long storeId, String weChatId, Integer orderState);

    void refund(Long id,String remark,Integer code);

    Integer findOrderStateById(Long id);

    void cancelOrder(Long id,String weChatId, Integer code);

//    void payMoney(Long id,String weChatId, Integer code);

    List<Order> findDistributorOrderByDate(@Param("userTripDate") String userTripDate, @Param("storeId") Long storeId);

    int countOrders(Long scenicId, Date tripDate);

    //修改出行人状态为停用
    void updateOrderDetailsStatus(Long orderId);

    Order findCOrderById(@Param("id") Long id, @Param("weChatId") String weChatId);

    Order findBOrderById(@Param("id") Long id, @Param("storeId") Long storeId);

//    void confirmRefund(OrderStateVo orderStateVo);
}
